package com.wenc.psi.fgmt.homefgmt;

import android.os.Bundle;

import androidx.databinding.DataBindingUtil;
import androidx.fragment.app.Fragment;
import androidx.navigation.NavController;
import androidx.navigation.Navigation;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.wenc.psi.R;
import com.wenc.psi.databinding.FragmentStartBinding;


public class StartFragment extends Fragment {

    private FragmentStartBinding binding;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        binding = DataBindingUtil.inflate(inflater, R.layout.fragment_start, container, false);
        binding.btSale.setOnClickListener((view)->{
            NavController navController = Navigation.findNavController(view);
            navController.navigate(R.id.action_startFragment_to_saleFragment);
        });
        binding.btPresale.setOnClickListener((view)->{
            NavController navController = Navigation.findNavController(view);
            navController.navigate(R.id.action_startFragment_to_preSaleFragment);
        });
        binding.btPurchase.setOnClickListener((view)->{
            NavController navController = Navigation.findNavController(view);
            navController.navigate(R.id.action_startFragment_to_purchaseFragment);
        });
        binding.btPrepurchase.setOnClickListener((view)->{
            NavController navController = Navigation.findNavController(view);
            navController.navigate(R.id.action_startFragment_to_prePurchaseFragment);
        });

        return binding.getRoot();
        // Inflate the layout for this fragment
//        return inflater.inflate(R.layout.fragment_start, container, false);
    }
}